package com.css.fxfzdzzh.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Dbj
 * @date 2023年02月24日  16:15
 */
@Getter
@AllArgsConstructor
public enum DataCategoryEnum {
    RIVERSYSTEM("riverSystem", "水系"),
    LITHOLOGY("lithology", "底层岩性"),
    PGA("pga", "地震动峰值加速度数据"),
    CLIMATIC("climatic", "气候"),
    LANDFORM("landform", "地形地貌"),
    ACTIVEFAULT("activeFault", "活断层"),
    LOAD("load", "道路"),
    ;
    /**
     * 状态码
     */
    private final String category;
    /**
     * 状态描述
     */
    private final String desc;

    public static DataCategoryEnum getEnumByState(Integer state) {
        for (DataCategoryEnum value : values()) {
            if (value.getCategory().equals(state)) {
                return value;
            }
        }
        throw new RuntimeException("状态错误");
    }
}
